import {createRouter, createWebHistory} from "vue-router";
import StudentBill from "../view/BillManage.vue";
import LoginView from "../view/LoginView.vue";
import Home from "../view/Home.vue";
import StudentManage from "../view/StudentManage.vue";
import TeacherManage from "../view/TeacherManage.vue";
import CourseManage from "../view/CourseManage.vue";


const routes = [
    {
        // 登陆界面路由
       name: "LoginView",                            
        path: "/",
        component: LoginView                    //连接LoginView.vue这个组件
    },
    {
        // 主界面
        path: "/home",
        name: "Home",
        component: Home,
        children: [                                             //左侧显示菜单右侧显示不同菜单下的内容就是用children
            {
                name: "StudentBill",
                path: "/home/studentBill",
                component: StudentBill                          //BillMange.vue,账目管理
            },
            {
                name: "StudentManage",
                path: "/home/studentManage",
                component: StudentManage                        //studentMange.vue,学生管理
            },
            {
                name: "TeacherManage",
                path: "/home/teacherManage",
                component: TeacherManage                        //TeacherMangage.vue,教师管理
            },
            {
                name: "CourseManage",
                path: "/home/courseManage",
                component: CourseManage                         //CourseMange.vue,课程管理
            }

        ]

    },
]

const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

export default router